# -*- coding: utf-8 -*-
# @Time    : 2022/5/25 0:35
# @Author  : yangqing
# @Email   : 1292504517@qq.com
# @File    : page_order_submission.py
# @Software: PyCharm
'''提交订单页'''
from selenium.webdriver.common.by import By
from time import sleep
from page.page_base import BasePage
class OrderSubmission(BasePage):
    # def __init__(self, driver):
    #     self.driver = driver
    # 找到配送方式
    ele_DM_select_locator = (By.XPATH, '/html/body/div[7]/form/div[5]/table/tbody/tr[3]/td[1]/input')
    # 找到支付方式
    ele_pay_select_locator = (By.XPATH, '//*[@id="paymentTable"]/tbody/tr[2]/td[1]/input')
    # 找到提交订单
    ele_submit_of_locator = (By.CSS_SELECTOR, '#theForm > div:nth-child(14) > div:nth-child(3) > input[type=image]:nth-child(1)')


    # # 选择商品包装方式
    ele_pack_select_locator = (By.XPATH,"/html/body/div[7]/form/div[9]/table/tbody/tr[3]/td[1]/input")

    # # 选择配送方式点击
    def Distribution_mode(self):
        self.driver.find_element(*self.ele_DM_select_locator).click()
        sleep(2)

    # # 选择支付方式点击
    def payment(self):
        self.driver.find_element(*self.ele_pay_select_locator).click()
        sleep(2)


    # # 点击提交订单
    def submit(self):
        self.driver.find_element(*self.ele_submit_of_locator).click()
        sleep(5)

